{% extends 'task_market/base.html' %}
{% load static %}


{% block title %}
    任务审核
{% endblock %}

{% block content %}

    <div class="breadcrumbs">
        <div class="container">
            <div class="row">
                <div class="col-12">
                    <div class="bread-inner">
                        <ul class="bread-list">
                            <li><a href="{% url 'task_market:index' %}" target="_blank">主页<i
                                    class="ti-arrow-right"></i></a></li>
                            <li><a href="{% url 'manager:task_admin' condition='checking' %}" target="_blank">任务市场<i
                                    class="ti-arrow-right"></i></a></li>
                            <li class="active"><a href="#">待审核</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <section class="shop section">
        <div class="container">
            <div class="row">
                <div class="col-lg-12 mx-auto">
                    <div class="account-content">
                        <h4 class="account-content-title"><i class="far fa-shopping-bag"></i> 任务审核
                            ({{ task_details.task_name }})</h4>
                        <div class="account-content-table">
                            <div class="table-responsive">
                                <table class="table table-borderless">
                                    <tr>
                                        <th>任务ID</th>
                                        <th>发布者ID</th>
                                        <th>任务类型</th>
                                        <th>任务描述</th>
                                        <th>任务等级</th>
                                        <th>审核</th>
                                    </tr>

                                    <tr class="account-order-list order-single-product">
                                        <td>
                                            <div class="product-info">{{ task_details.id }}</div>
                                        </td>
                                        <td>
                                            <div class="product-info">{{ task_details.task_publish_id|truncatechars:8 }}</div>
                                        </td>
                                        <td>
                                            <div class="product-info">{{ task_details.task_type }}</div>
                                        </td>
                                        <td>
                                            <div class="product-info">{{ task_details.task_description }}</div>
                                        </td>
                                        <td>
                                            <div class="product-info">{{ task_details.task_rank }}</div>
                                        </td>
                                        <td>
                                            <div class="product-info">
                                                <a href="{% url 'manager:check' task_id=task_details.id res=0 %}"
                                                   class="content-action content-action-mr"> 通过</a>
                                                <a href="{% url 'manager:check' task_id=task_details.id res=1 %}"
                                                   class="content-action content-action-mr"> 不通过</a>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        </div>
    </section>

    <section class="shop section">
        <div class="container">
            <div class="row">
                <div class="col-lg-12 mx-auto">
                    <div class="account-content">
                        <h4 class="account-content-title"><i class="far fa-shopping-bag"></i> 任务数据
                            ({{ task_details.task_name }})</h4>
                        <div class="account-content-table">
                            <div class="table-responsive">
                                <table class="table table-borderless">
                                    <tr>
                                        <th>内容编号</th>
                                        <th>内容信息</th>
                                        <th>内容类型</th>
                                    </tr>
                                    {% for content in content_details %}
                                        <tr class="account-order-list order-single-product">
                                            <td>
                                                <div class="product-info">{{ content.taskdata_id }}</div>
                                            </td>
                                            {% if task_details.task_type == '1' %}
                                                <td>
                                                    <div class="product-info">{{ content.taskdata_content }}</div>
                                                </td>
                                            {% elif task_details.task_type == '4' or task_details.task_type == '5' %}
                                                <td>
                                                    <div class="product-info"><img
                                                            src="/images/{{ content.taskdata_content }}" width="60"></div>
                                                </td>
                                            {% endif %}
                                            {% if task_details.task_type == '1' %}
                                                <td>
                                                    <div class="product-info">文本分类</div>
                                                </td>
                                            {% elif task_details.task_type == '4' %}
                                                <td>
                                                    <div class="product-info">图片分类</div>
                                                </td>
                                            {% elif task_details.task_type == '5' %}
                                                <td>
                                                    <div class="product-info">图片框选</div>
                                                </td>
                                            {% endif %}
                                        </tr>
                                    {% endfor %}
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        </div>
    </section>

{% endblock %}